import { getDisplaySize } from "./autox";
import { ramdomByFloat } from "./ramdomByFloat";
import { smlMove } from "./smlMove";

export function swipeUp() {
    // 导入AutoJS依赖
    const height = device.height;
    const width = device.width;
    // 模拟上划操作
    swipe(width / 2, height * 4 / 5, width / 2, height / 10, 300);
}

/**
 * 直播间随机滑动
 */
export function liveSwipeUp(time: number = 200, float: number = 1.25) {
    const [width, height] = getDisplaySize()
    smlMove(ramdomByFloat(width / 2 - width / 10, float), ramdomByFloat(height * 0.8, float), ramdomByFloat(width / 2 - width / 10, float), ramdomByFloat(height * 0.1, float), time);
}

/**
 * 随机滑动
 */
export function liveSwipeDown(time: number = 200, float: number = 1.25) {
    const [width, height] = getDisplaySize()
    smlMove(ramdomByFloat(width / 2, float), ramdomByFloat(height * 0.2, float), ramdomByFloat(width / 2, float), ramdomByFloat(height * 0.8, float), time);
}
